package binderipcservicemanager
import android.os.Bundle
import androidx.core.app.BundleCompat
import bindipcbase.BaseContentProvider

class ServiceManagerContentProvider : BaseContentProvider() {

    private val mBCAdvancedService by lazy {
        BCAdvancedServiceManagerService()
    }

    override fun call(method: String, arg: String?, extras: Bundle?): Bundle? {
        if (AdvancedServiceManagerConstant.ACTION_ADVANCED_GET_SERVICE == method) {
            val bundle = Bundle()
            BundleCompat.putBinder(bundle, AdvancedServiceManagerConstant.KEY_ADVANCED_SERVER, mBCAdvancedService)
            return bundle
        }
        return super.call(method, arg, extras)
    }

}